{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "a63a44f9",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 函数的定义\n",
    "def search4vowels(word):\n",
    "    \"\"\"找出文本中出现的元音字母\"\"\"\n",
    "    return set(\"aeiou\") & set(word)\n",
    "\n",
    "\n",
    "def news_链接(url,新闻分类,page):\n",
    "    \"\"\"抓取学校新闻的所有页面链接\n",
    "    url:学校网站的域名链接\n",
    "    新闻分类:学校新闻的分类英文简称\n",
    "    page:你想要抓取的页面尾页\n",
    "    \"\"\"\n",
    "    \n",
    "    news_链接 = []\n",
    "    for i in range(0,int(page)):\n",
    "        if i == 0:\n",
    "            index_链接 = url + 新闻分类 + '/index.htm'\n",
    "            news_链接.append(index_链接)\n",
    "        else:\n",
    "            index_链接 = url + 新闻分类 + '/index'+ str(i)+ '.htm'\n",
    "            news_链接.append(index_链接)       \n",
    "    return news_链接"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
